<script>

    // 动物类 ES5
    function Animal(look){
        this.look = look
    } 
    Animal.prototype.eat = function(){
        return '正在干饭中....'
    }

    // // 两栖类
    // function Amphibians(look,color){     
    //     this.color = color
    //     Animal.call(this,look)
    // }
    // Animal.prototype.waterInto = function(){
    //     return '游完泳准备上岸了....'
    // }
    // Amphibians.prototype.__prototype = Animal.prototype;
   


    // 动物类 (两栖类) ES6
    class Amphibians extends Animal {
        constructor(look,color){
            super(look)
            this.color = color
        }
        waterInto(){
            return '游完泳准备上岸了....'
        }
    }
    let a1 = new  Amphibians('头大大的','渐变色')
    console.log(a1);


    // 哺乳类 ES5

    // function Mammals(color,leg,look){
    //     this.color = color;
    //     this.leg = leg
    //     Animal.call(this,look)
    // }
    // Mammals.prototype.creep = function(){
    //     return '它没事就喜欢在地上爬着......'
    // }
    // Mammals.prototype.__proto__ = Animal.prototype
    

    // ES6
    class Mammals extends Animal {
        constructor(color,leg,look){
            super(look)
            this.color = color;
            this.leg = leg
        }
        creep(){
            return '它没事就喜欢在地上爬着..........'
        }
    }
    let a2 = new Mammals('渐变黑','2只脚','尾巴长长的')
    console.log(a2);


    // 虎类 ES5
    // function Tiger(type,speed,color,leg,look){
    //     this.type = type;
    //     this.speed = speed
    //     Mammals.call(this,color,leg,look)
    // }
    //    Tiger.prototype.hunt = function(){
    //        return '它正在扑杀水牛....'
    //    }
    // Tiger.prototype.__proto__ = Mammals.prototype
    // let a3 = new Tiger('东北虎','70赫兹','渐变黄','4个脚','巨帅')
    // console.log(a3);
    //ES6
    class Tiger extends Mammals{
        constructor(type,speed,color,leg,look){
            super(color,leg,look)
            this.type = type;
            this.speed = speed;
        }
        hunt(){
            return '它正在扑杀水牛....'
        }    
    }
    let a3 = new Tiger('东北虎','70赫兹','渐变黄','4个脚','巨帅')
    console.log(a3);



    // 鸟类 ES5
    // function Bird(color,wingspan,look){
    //     this.color = color;
    //     this.wingspan = wingspan;
    //     Animal.call(look)
    // }
    // Bird.prototype.fly = function(){
    //     return '它正在和它的好朋友在天空上快乐的飞翔着....'
    // }
    // Bird.prototype.__proto__ = Animal.prototype
    
    // ES6
    class Bird extends Animal{
        constructor(color,wingspan,look){
            super(look)
            this.color = color;
            this.wingspan = wingspan;
        }
        fly(){
            return '它正在和它的好朋友在天空上快乐的飞翔着....'
        }
    }
    let a4 = new Bird('渐变白','8米','秃头小宝贝')
    console.log(a4);


    // 鹰类
    // ES5
    // function Eagle(type,speed,vision,color,wingspan,look){
    //     this.type = type;
    //     this.speed = speed;
    //     Bird.call(color,wingspan,look)
    // }
    // Eagle.prototype.hunt = function(){
    //     return '它正在扑杀巨齿仓鼠....'
    // }
    // Eagle.prototype.__proto__ = Bird.prototype
    // let a5 = new Eagle('风暴猎鹰','100光速','视力极佳，不知其多少度也','渐变绿','其翼不知其几千里也','其夸张程度不可描述也')

    //ES6
    class Eagle extends Bird{
        constructor(type,speed,vision,color,wingspan,look){
            super(color,wingspan,look)
            this.type = type;
            this.speed = speed;
        }
        hunt(){
            return '它正在扑杀巨齿仓鼠.....'
        }
    }
    let a5 = new Eagle('风暴猎鹰','100光速','视力极佳，不知其多少度也','渐变绿','其翼不知其几千里也','其夸张程度不可描述也')
    console.log(a5);
    
</script>